Skip to content

QuadDictionary class

Attributes: [DefaultMember("Item")] [DebuggerDisplay("QuadDictionary: {Count}")]

Defined in

Namespace: ReactiveList.Reactive.Collections Assembly: ReactiveList.Reactive.dll Full name: ReactiveList.Reactive.Collections.QuadDictionary<T1, T2> Modifiers: public sealed

Summary

View source (opens in a new tab)

        Provides a high-performance, pooled hash table for storing key/value pairs, supporting fast lookup and insertion
        operations with customizable key equality comparison.

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

Class hierarchy
classDiagram
class QuadDictionary~T1,T2~
class IQuad~KeyValuePair~TKey, TValue~~ {
    <>
}
IQuad~KeyValuePair~TKey, TValue~~ <|.. QuadDictionary~T1,T2~
class IEnumerable~KeyValuePair~TKey, TValue~~ {
    <>
}
IEnumerable~KeyValuePair~TKey, TValue~~ <|.. QuadDictionary~T1,T2~
class IEnumerable {
    <>
}
IEnumerable <|.. QuadDictionary~T1,T2~
class IDisposable {
    <>
}
IDisposable <|.. QuadDictionary~T1,T2~

Implements: IQuad>, IEnumerable> (opens in a new tab), IEnumerable (opens in a new tab), IDisposable (opens in a new tab)

Remarks

        QuadDictionary is an internal shard optimized for scenarios where frequent additions and lookups are required,
        and memory efficiency is important. It uses array pooling to minimize allocations and supports custom equality
        comparers for keys. The dictionary is not thread-safe and should not be accessed concurrently from multiple threads.
        Call Dispose to return internal arrays to the pool when the dictionary is no longer needed.
        Change notifications are NOT emitted from this class - the parent QuaternaryDictionary handles all notifications
        through its Stream pipeline.

Constructors

NameSummary
.ctorInitializes a new instance of the QuadDictionary class with default settings.

Properties

NameSummary
CountGets the number of key/value pairs contained in the dictionary.
KeysGets all keys in the dictionary.
ValuesGets all values in the dictionary.
this[]Gets or sets the value associated with the specified key.

Methods

NameSummary
GetValueRefOrAddDefaultGets a reference to the value for the specified key, adding a default entry if the key does not exist.
TryAddAttempts to add the specified key and value to the dictionary.
AddAdds the specified key and value to the dictionary.
TryGetValueGets the value associated with the specified key.
ContainsKeyDetermines whether the dictionary contains the specified key.
RemoveRemoves the value with the specified key from the dictionary.
ClearRemoves all keys and values from the dictionary.
EnsureCapacityEnsures that the dictionary can hold up to the specified number of entries without resizing.
GetEnumeratorReturns an enumerator that iterates through the dictionary.
CopyKeysToCopies all keys to a list.
CopyValuesToCopies all values to a list.
CopyToCopies all key/value pairs to a list.
DisposeReturns arrays to pool and cleans up resources.
Inherited members